<?PHP
 session_start();
 include("admin/include/db.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=TITLE_WEBSITE?></title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<center>
<div style="background:#179cc1; height:3px">&nbsp;</div>
<div style="width:990px;" align="center">
	<div id="header">
		<?php
    		include("includes/header.php");
   		?>
        <div style=" padding:0px;margin-top:5px;">
  
    	<?php
        	$sqlBackground = mysql_query("SELECT * FROM software_main_banner  ORDER BY rand() LIMIT 1 ");
			$resBackground = mysql_fetch_array($sqlBackground);
		?>
   
    </div> </div>
    
    <div style="margin-top:1px">
    	<div style="float:left; width:660px" >
        	<div align="left" >
            	<span class="heading" >Welcome to</span> &nbsp;<span class="headingOrange">E-Learning System !</span>
            </div>
            <div class="text1"  align="left" style=" padding-top:18px">
         		<?=nl2br(substr($resBackground["banner_comments"],0,900))?>&nbsp;&nbsp;&nbsp;<a href="main_detail.php" class="link" >&nbsp;Learn More</a>
            </div>
        </div>
        <div style="float: right" >
         <?php
			if($_SESSION['user_id'] == 0 || $_SESSION['user_id'] == ""  )
			{
			?>
        	<a href="login.php" ><img src="images/course_28.jpg" border="0"  /></a>
        	<?php
			}else{
				if($_SESSION['user_type'] == 'Student')
				{
					$userTypelink = 'std_profile_update.php';
				}elseif($_SESSION['user_type'] == 'Trainer'){
					$userTypelink = 'trainer_profile_update.php';
				}
				
			?>
          <a href="<?=$userTypelink?>" ><img src="images/course_register.jpg" border="0"  /></a>
            <?php
			}
			?><br/>
            
        </div>
        <div style="clear:both"></div>
    </div>
    <div style="margin-top:30px">
    	 
        <div style="float:left; width:314px; height:335px; background:url(images/tray.gif) no-repeat; margin-left:23px">
        	<div class="trayHeading" align="left"  style="padding-left:20px; padding-top:7px" >
            	Get Career Assistance
            </div>
            <div style="margin-top:14px;">
            	<img src="images/course_hand.gif"  />
            </div>
            <div  class="text" align="left"  style="width:290px; margin-top:17px ">
         	<?php
            $sqlPages = mysql_query("SELECT * FROM software_pages WHERE page_id = '26'");
 			$resPages = mysql_fetch_array($sqlPages);
			echo nl2br(substr($resPages["page_description"],0,200))?>...
		
            </div>
            <div style="clear:both"></div>
            <div class="trayButton"  align="left" style="margin-top:-40px; margin-left:17px"><a href="pages.php?page_id=26" class="text-white-not">Get More Detail</a></div>
        </div> 
        <div style="float:left; width:314px; height:335px; background:url(images/tray.gif) no-repeat; margin-left:23px">
      	 	<div class="trayHeading" align="left"  style="padding-left:20px; padding-top:7px" >
            	Latest Updated News
            </div>
             
            <div style="margin-top:30px" >
           <marquee direction="up"  height="220" width="290px">
           		<div>
                <?php
                	$sqlHeadings = mysql_query("SELECT * FROM software_headlines WHERE active = 'Y'");
					while($resHeadings = mysql_fetch_array($sqlHeadings)){
				?>
            	<div style="margin-top:15px" >
                	<div class="text-bold" align="left" style="width:290px" ><?php echo $resHeadings["headline_heading"]?></div>
                    <div class="text"  align="left" style="width:290px;margin-top:10px" >
                    <?php echo nl2br(substr($resHeadings["headline_desc"],0,200)).'...'?>
                    </div>
                    <div style=" border-bottom:2px dotted #000000; height:2px;width:290px;margin-top:10px" ></div>
                </div>
                <?php
						sleep(3);
					}
				?>
                </div>
              </marquee> 
				<div class="trayButton"  align="left" style="margin-top:25px; margin-left:17px"><a href="headlines.php" class="text-white-not" >Get More Detail</a></div>
          
            </div>
           
        </div> 
        <div style="clear:both" ></div>
    </div>
    
  </div>
   <div id="footer">
  		<?php include("includes/footer.php")?>
   </div>
</div>
	</div>
</center>
</body>
</html>
